package cn.juque.lucenecandy.core.base;

import cn.juque.lucenecandy.core.annotation.Field;
import cn.juque.lucenecandy.core.enums.DataTypeEnum;
import cn.juque.lucenecandy.core.enums.FieldFillEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * @author nuoka
 */
@Data
public class BaseEntity implements Serializable {

    /**
     * 唯一标识
     */
    @Field(value = "_id", isId = true, fills = {FieldFillEnum.INSERT})
    private String id;

    /**
     * 创建时间
     */
    @Field(value = "_create_time", type = DataTypeEnum.DATE, fills = {FieldFillEnum.INSERT})
    private Date createTime;

    /**
     * 更新时间
     */
    @Field(value = "_update_time", type = DataTypeEnum.DATE, fills = {FieldFillEnum.INSERT, FieldFillEnum.UPDATE})
    private Date updateTime;

    /**
     * 版本号
     */
    @Field(value = "_version", type = DataTypeEnum.INT, fills = {FieldFillEnum.INSERT, FieldFillEnum.UPDATE})
    private Integer version;

    /**
     * 是否可见
     */
    @Field(value = "_visible", type = DataTypeEnum.INT, stored = false, fills = {FieldFillEnum.INSERT, FieldFillEnum.UPDATE})
    private Integer visible;

    /**
     * 附加信息
     */
    private Set<String> attachInfo;
}
